#ifndef PIPE_H
#define PIPE_H
#include "../main_head.h"

class Pipe 
{
private:
	GLfloat position[40] = {        
		 0.065f, -0.13f, 0.1f,   1.0f, 1.0f, // Top Right
		 0.065f, -1.5f, 0.1f,    1.0f, 0.0f, // Bottom Right
		-0.065f, -1.5f, 0.1f,    0.0f, 0.0f, // Bottom Left
		-0.065f, -0.13f, 0.1f,   0.0f, 1.0f, // Top Left

		 0.065f,  1.5f, 0.1f,    1.0f, 0.0f, // Top Right
		 0.065f,  0.13f, 0.1f,   1.0f, 1.0f, // Bottom Right
		-0.065f,  0.13f, 0.1f,   0.0f, 1.0f, // Bottom Left
		-0.065f,  1.5f, 0.1f,    0.0f, 0.0f, // Top Left
	};
	GLuint indices[12] = {  // Note that we start from 0!
		0, 1, 3,
		1, 2, 3,

		4, 5, 7,
		5, 6, 7
	};

	GLuint VBO, VAO, EBO, Program, texture;
	GLint control = 0, which = 0, N = 3350, control_all = 0;
	GLboolean live = 1;
	glm::mat4 view;

	void move();
	void change_model(GLint which);
public:
	void set_control(GLint _control) { control = _control; }
	void set_which(GLint _which) { which = _which; }
	void set_N(GLint _N) { N = _N; }
	void set_control_all(GLint _control_all) { control_all = _control_all; }
	void set_live(GLboolean _live) { live = _live; }
	glm::vec3 pipePositions[6] = {
		glm::vec3(0.6f,  0.0f,  0.0f),
		glm::vec3(1.2f,  0.0f,  0.0f),
		glm::vec3(1.8f,  0.0f,  0.0f),
		glm::vec3(2.4f,  0.0f,  0.0f),
		glm::vec3(3.0f,  0.0f,  0.0f),
		glm::vec3(3.6f,  0.0f,  0.0f)
	};
	Pipe(GLint _program);
	void set_live(GLint _live);
	void load_image();
	void load_coord();
	void draw(GLboolean start);
	void burn();
	GLint _control_all();

	friend class Bird;
};

#endif


